Skip to content

fix(MAA): 剿灭周完成判定必须有进度行佐证 (release/v5.4.0) - #664

Merged
1w1w11w1 merged 1 commit into
AUTO-MAS-Project:release/v5.4.0from
1w1w11w1:cherry-pick/v5.4.0-annihilation-week
Sep 11, 2026
Merged

1w1w11w1 merged 1 commit into
AUTO-MAS-Project:release/v5.4.0from
1w1w11w1:cherry-pick/v5.4.0-annihilation-week

Conversation

@1w1w11w1

@1w1w11w1 1w1w11w1 commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

自 dev 回移 #662(fix(MAA): 剿灭周完成判定必须有进度行佐证)。

  • 测试按 485aa62 先例加 import app.core 守卫,规避 v5.4.0 的循环导入

本地验证

  • python -m pytest tests/task/test_maa_annihilation_week.py -q:2 passed

Sourcery 摘要

在将任务视为完成之前,确保通过进度证据确认湮灭周已完成。

错误修复:

  • 要求存在一条有效的湮灭周进度记录,且进度达到或超过每周上限,然后才将 MAA 任务视为已完成,从而避免将无进度的完成日志误判为已完成。

测试:

  • 增加对达到上限、低于上限以及缺少进度的湮灭周日志的测试覆盖。
Original summary in English

Summary by Sourcery

Ensure annihilation-week completion is confirmed by progress evidence before accepting the task as complete.

Bug Fixes:

  • Require a valid annihilation-week progress line at or above the weekly cap before treating the MAA task as completed, preventing no-progress completion logs from being misclassified.

Tests:

  • Add coverage for capped, below-cap, and missing-progress annihilation-week logs.

MAA 理智不足无法开战时同样打印「完成任务: 剿灭作战」且无进度行,与已达周上限在日志上不可区分,此前会被误记为本周已完成,当周剩余剿灭不再执行。

无进度行一律视为未达标,宁可下次重试(不进入战斗、不浪费理智);用户在 MAS 接管前手动打满当周剿灭时,当周每日会多一次空跑重试。

(cherry picked from commit 3e28fe2)
@sourcery-ai

sourcery-ai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

审查者指南

该 PR 通过要求同时存在完成日志标记,以及达到或超过每周额度的已解析进度行,回移了剿灭周完成判定修复,从而避免将没有进度的 MAA 日志错误地判定为已完成。该 PR 还增加了回归测试覆盖,以及针对测试环境的版本专用导入保护。

剿灭周完成判定流程图

flowchart TD
    A["解析剿灭周日志"] --> B{"存在进度行?"}
    B -- 否 --> C["判定未完成"]
    B -- 是 --> D{"包含完成任务标记且进度达到额度?"}
    D -- 否 --> C
    D -- 是 --> E["判定已完成"]
Loading

文件级变更

变更 详情 文件
在将操作视为已完成之前,要求存在明确的每周剿灭进度行。
  • 保留现有的完成标记要求。
  • 拒绝没有已解析进度的日志,避免 MAA 因缺少理智而无法启动时产生误判。
  • 当报告的进度达到或超过每周上限时,接受完成判定。
app/task/MAA/AutoProxy.py
为达到上限、低于上限以及没有进度的剿灭日志添加针对性的回归测试。
  • 覆盖恰好达到上限和超过上限时的完成情况。
  • 验证缺少进度或进度不足时不会被视为已完成。
  • 在测试中初始化 app.core,以避免版本分支中的循环导入问题。
tests/task/test_maa_annihilation_week.py

可能关联的问题

  • #剿灭状态标记错误:该 PR 通过将没有足够剿灭进度的完成日志判定为未完成且可重试,修复了这一具体问题。

提示和命令

与 Sourcery 交互

  • 触发新的审查: 在 pull request 中评论 @sourcery-ai review。
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 从审查评论创建 GitHub issue: 回复审查评论,请 Sourcery 根据该评论创建 issue。你也可以使用 @sourcery-ai issue 回复审查评论,以根据该评论创建 issue。
  • 生成 pull request 标题: 在 pull request 标题的任意位置写入 @sourcery-ai,即可随时生成标题。你也可以在 pull request 中评论 @sourcery-ai title,以随时(重新)生成标题。
  • 生成 pull request 摘要: 在 pull request 正文中任意位置写入 @sourcery-ai summary,即可在指定位置随时生成 PR 摘要。你也可以在 pull request 中评论 @sourcery-ai summary,以随时(重新)生成摘要。
  • 生成审查者指南: 在 pull request 中评论 @sourcery-ai guide,即可随时(重新)生成审查者指南。
  • 解决所有 Sourcery 评论: 在 pull request 中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已经处理完所有评论且不想再看到它们,这会非常有用。
  • 忽略所有 Sourcery 审查: 在 pull request 中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 审查。如果你想从新的审查开始,这尤其有用——别忘了评论 @sourcery-ai review 来触发新的审查!

自定义你的使用体验

访问你的控制面板以:

  • 启用或禁用审查功能,例如 Sourcery 生成的 pull request 摘要、审查者指南等。
  • 更改审查语言。
  • 添加、删除或编辑自定义审查说明。
  • 调整其他审查设置。

获取帮助

Original review guide in English

Reviewer's Guide

The PR backports the annihilation-week completion fix by requiring both the completion log marker and a parsed progress line at or above the weekly quota, preventing no-progress MAA logs from being misclassified as completed. It adds regression coverage and a release-specific import guard for the test environment.

Flow diagram for annihilation-week completion判定

flowchart TD
    A["解析剿灭周日志"] --> B{"存在进度行?"}
    B -- 否 --> C["判定未完成"]
    B -- 是 --> D{"包含完成任务标记且进度达到额度?"}
    D -- 否 --> C
    D -- 是 --> E["判定已完成"]
Loading

File-Level Changes

Change Details Files
Require an explicit weekly annihilation progress line before treating the operation as completed.
  • Keep the existing completion marker requirement.
  • Reject logs with no parsed progress, avoiding false positives when MAA lacks sanity to start.
  • Accept completion when reported progress reaches or exceeds the weekly cap.
app/task/MAA/AutoProxy.py
Add focused regression tests for capped, under-cap, and progress-less annihilation logs.
  • Cover exact-cap and over-cap completion.
  • Verify missing or insufficient progress is not considered complete.
  • Initialize app.core in the test to avoid the release-branch circular import.
tests/task/test_maa_annihilation_week.py

Possibly linked issues

  • #剿灭状态标记错误: PR fixes the exact issue by treating completion logs without sufficient annihilation progress as incomplete and retryable.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你好——我已经审阅了你的更改,看起来很棒!

Sourcery 评估

已批准。


Sourcery 对开源项目免费——如果你喜欢我们的评审,请考虑分享 ✨
Original comment in English

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@1w1w11w1
1w1w11w1 merged commit c2cc5f2 into AUTO-MAS-Project:release/v5.4.0 Sep 11, 2026
1 of 2 checks passed
1w1w11w1 added a commit that referenced this pull request Sep 18, 2026
## 摘要

- 自 dev 回移 #686(`0865bb5a`)与 #760(`d8efbbd1`)两个剿灭判态修复到 v5.4.0 热更通道,均以
`cherry-pick -x` 标注来源
- 修复一:周内剿灭已在代理开始前打满时,MAA 不进入战斗流程、只输出「完成任务: 剿灭作战」,此前会被判成「MAA
部分任务执行失败」并当周反复空跑;现在按「理智: x / y」识别行区分本次是否进过战斗流程,无识别行即视为周内已完成
- 修复二:剿灭因理智不足空跑(完成行 + 理智行 + 无进度行)时不再整轮重试(关模拟器、重启 MAA、最多 RunTimesLimit
次),改为 Success 收尾、周完成标记不写入,留待下次调度续打
- 只含 `app/task/MAA/AutoProxy.py` 与
`tests/task/test_maa_annihilation_week.py`,不含 `frontend/` 与 API schema
变更

## 与 dev 的差异

- 两个提交各自携带的 `CHANGELOG.md`、`res/version.json` 与 `changelog.d/`
碎片已按本分支惯例丢弃(本分支不发版 PR、不改版本号)
- #760 的 Fight 完成判定处上下文与 dev 不同,冲突取 dev 侧单行(`or (en_task == "Fight" and
"完成任务: 剿灭作战" in log)`)
- 测试沿用 485aa62 先例的 `import app.core` 守卫,规避本分支的循环导入
- 未在 `res/version.json` 的 v5.4.0 节登记修复条目:#664 同样未动,AGENTS.md 也写明该文件只由发版
PR 更新。若维护者希望登记,我可以补一行

## 本地验证

- `pytest tests/task/test_maa_annihilation_week.py` + 3 个走真实 `check_log`
的临时用例:6 passed
- 同一组临时用例在未回移的 pristine release/v5.4.0 上 3 个全失败(周内已完成不记周标记、理智不足空跑报「MAA
部分任务执行失败」),确认修复点被覆盖
- 临时用例属于一次性验证产物,未提交

## 已知既有失败(非本次引入)

-
`tests/task/test_maa_annihilation_schedule.py::test_maa_annihilation_limit_records_the_current_week[log_content0]`
在 pristine release/v5.4.0 上即失败(只给「剿滅模式 : 1800 /
1800」不给完成行)。本次回移未改该预期,也未顺带修改,以免超出小体量回移范围
- 该测试文件在 dev 上已删除(56885edd)

关联 #686、#760

## Sourcery 摘要

修复湮灭周常状态检测,使其能够区分已完成配额和因理智不足而无法继续推进的运行。

错误修复:
- 修正湮灭周常完成状态检测:处理在代理前周常配额已达成,或因理智不足而无法开始战斗的情况。
- 防止因理智不足而中止的湮灭运行被视为任务失败并被不必要地重试。

增强功能:
- 使 Fight 任务的完成处理与湮灭完成日志保持一致。
- 增加对预先完成、已完成、未完成和理智不足等湮灭场景的回归测试。

<details>
<summary>Original summary in English</summary>

## Sourcery 总结

修复 MAA 剿灭周常状态判定,避免已完成任务被重复执行并妥善处理理智不足的运行。

错误修复:
- 修复剿灭周常完成状态检测,正确区分代理前已完成额度、因理智不足未开始战斗和未打满进度的情况。
- 避免因理智不足导致的剿灭运行被误判为失败并重复重试。

增强功能:
- 统一 Fight 任务对剿灭完成日志的处理,并补充相关场景的回归测试。

测试:
- 增加剿灭周常预先完成、达到额度、进度不足和理智不足等场景的回归测试。

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

修复 MAA 剿灭周常状态判定,避免已完成任务被重复执行并妥善处理理智不足的运行。

Bug Fixes:
- 修复剿灭周常完成状态检测,正确区分代理前已完成额度、因理智不足未开始战斗和未打满进度的情况。
- 避免因理智不足导致的剿灭运行被误判为失败并重复重试。

Enhancements:
- 统一 Fight 任务对剿灭完成日志的处理,并补充相关场景的回归测试。

Tests:
- 增加剿灭周常预先完成、达到额度、进度不足和理智不足等场景的回归测试。

</details>

</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant